{extend name="$BASE_LIST" /}
{block name="body"}
<div class="right-main">
    <div class="page_nav" id="js_page_nav"><span class="page_title">系统协议管理</span></div>

    <table id="grid-table">
        <thead frozen="true">
        <th data-options="field:'agreement_title',width:500,align:'center',sortable: true">标题</th>
        </thead>
        <thead>
            <tr>
                <th data-options="field:'update_time',width:160,align:'center'">修改时间</th> 
                <th data-options="field:'_oper',halign:'center',formatter: formatOper">操作</th>
            </tr>
        </thead>
    </table>
</div>

{/block}
{block name="script"}
<script type="text/javascript">

    function formatOper(value, row, index) {
        var html = '<span class="grid-operation">';
        html += '<button type="button" onclick="edit(' + row['id'] + ')" class="btn btn-xs btn-default edit-btn"><i class="icon wb-edit"></i>编辑</button>';
        html += '</span>';
        return html;
    }


   
    $(function () {
        $('#grid-table').datagrid({
            url: getURL('loadList'),
            method: "GET",
            height: getGridHeight(),
            rownumbers: true,
            singleSelect: true,
            remoteSort: false,
            multiSort: true,
            emptyMsg: '<span>无相关数据</span>',
            pagination: true,
            pageSize: 20
        });
        //设置分页控件 
        $('#grid-table').datagrid('getPager').pagination({
            pageSize: 20, //每页显示的记录条数，默认为10 
            pageList: [20, 30, 50]
        });
    });

    function edit(id) {
        var url = getURL('edit_agreement', 'id=' + id);
        openBarWin('编辑', 1000, 650, url, function () {
    
                    location.reload();

        }, ['保存', '取消']);

    }



    $("#js_search").click(function () {
            reload();
        });
    function reload() {
        var keyword = $("#js_keyword").val();
        $('#grid-table').datagrid('reload', {
            keyword: keyword,
        });
    }
  
</script>
{/block}